A programmable controller is a type of general purpose industrial computer which controls the operation of manufacturing equipment, such as an assembly line or a machine tool, in accordance with a stored program. The program comprises a series of process control instructions which are read out and executed to examine the condition of selected sensing devices on the controlled equipment, and to energize or deenergize selected operating devices contingent upon the status of one or more of the examined sensing devices.
The state of many sensing and operating devices can be represented by a single bit of data which is manipulated by the control program instructions. Other devices, such as position sensors, provide multiple bits of data representing a condition of the equipment being controlled. For these latter devices, instructions are provided to manipulate bytes and words of data representing the state of the sensing and operating devices. Additional program instructions perform arithmetic operations, timing and counting functions, and complex statistical reporting operations. These instructions have become quite standardized in the industry and are directly associated with the elements of a ladder logic diagram which is easily understood by process control engineers. Program panels such as those described in U.S. Pat. Nos. 3,808,612; 3,813,649 and 4,070,702 have been developed to assist the user in developing and editing ladder logic control programs comprised of such programmable controller instructions.
As the need developed to control ever more complex manufacturing processes, the programmable controller and its set of instructions became more elaborate. A processor module which executed the instructions became divided into two different processor circuits, such as a Boolean logic processor for manipulating single bits of input and output data and a microprocessor for performing more complex arithmetic and logic operations. The Boolean logic processor directly executed a subset of the ladder logic instruction set. The microprocessor executed an interpreter program that contained a series of machine language routines for performing the functions defined by the remaining ladder logic program instructions. An example of this type of programmable controller is described in U.S. Pat. No. 4,165,534.
This evolution of the programmable controller also provided the main ladder logic program with the capability of calling a ladder logic subroutine. The subroutine was designated in the ladder diagram by inserting an operation block which had a fixed operation code (e.g. JSR) and which specified a unique program file that contained the instructions of the subroutine. In order to pass data from the main ladder logic program to the subroutine, the programmer has to specify each item of data in the subroutine operation block. Each time the subroutine was called from the main program, the parameters were copied sequentially one by one into a parameter list defined in the subroutine. A similar definition and copying process is required to transfer the results of the subroutine to the main ladder logic program. This dual copying process was relatively time consuming.
Previously each subroutine was stored in the programmable controller as a separate program file. Many programmable controllers have a limit on the number of program files which can be stored and accessed. As a consequence, the use of many subroutines could significantly reduce the number of program files available for other routines.
The need also developed to provide custom functions and ladder logic instructions for specific industries and certain types of industrial equipment. It is expensive and time consuming to redesign the processor hardware and software for each unique need. Thus it is often impractical to create special ladder logic instructions for each segment of the programmable controller market. To satisfy this need programmable controllers were developed that can execute a custom application routine written in machine language instructions and called from the ladder logic control program, as described in U.S. Pat. No. 4,302,820. Although this technique can be used effectively to provide custom, complex functionality to a conventional programmable controller, the transition to and from the execution of the machine language program consumed relatively long processing time as control had to be transferred from the ladder logic processor to the microprocessor. In addition, an end user accustomed to programming with ladder diagrams had difficulty preparing the custom application routines which had to be written in machine language instructions.